package com.ioc.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class BeanConfig {
    @Bean
    public String name(){
        return "zhangshan";
    }


    @Bean
    public UserInfo userInfo(String name){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(1);
        userInfo.setName(name);
        userInfo.setAge(2);
        return userInfo;
    }

    @Bean
    public UserInfo userInfo2(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(3);
        userInfo.setName("zzl");
        userInfo.setAge(5);
        return userInfo;
    }
}
